#实现斐波那契数列for实现
def fibonacci_for():
    L = [0, 1] #初始化列表
    i = 0 #定义一个初始的index
    for i in range(100): #定义0-99数值
        if i == 0 or i == 1:
            continue
        else:
            sum = L[i-2] + L[i-1]
            L.append(sum)
    return L

#实现斐波那契数列while实现
def fibonacci_while():
    L = [0, 1]
    i = 0
    while i < 100:
        if i == 0 or i == 1:
            i += 1
            continue
        else:
            sum = L[i-2] + L[i-1]
            L.append(sum)
        i += 1
    return L

if __name__ == '__main__':
    L1 = fibonacci_for()
    L2 = fibonacci_while()
    print(f"for实现：{L1}")
    print(f"while实现：{L2}")